package dk.eclipse.android.badassapp.helper;

import android.content.Context;
import android.net.ConnectivityManager;

public class ConnectionHelper {

	public static boolean isConnectedToInternet(Context context) {
	    ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
	    // test for connection
	    if (cm.getActiveNetworkInfo() != null
	            && cm.getActiveNetworkInfo().isAvailable()
	            && cm.getActiveNetworkInfo().isConnected()) {
	        return true;
	    } else {
	        return false;
	    }
	}

}
